package ch.zhaw.swp1.model.message;

import java.util.List;

import ch.zhaw.swp1.model.message.address.PrintAddress;
import ch.zhaw.swp1.model.message.body.PrintBody;
import ch.zhaw.swp1.model.status.Status;

/**
 * Class representing a print message
 * @author Daniel Tiefenauer
 */
public class Print extends Message {

	/**
	 * Default version
	 */
	private static final long serialVersionUID = 1L;

	/************************************************************************************/
	/* CONSTRUCTORS
	/*----------------------------------------------------------------------------------*/
	/**
	 * Default Constructor
	 */
	public Print() {
		// instantiate with correct types
		setSender(new PrintAddress());
		setBody(new PrintBody());
	}
	
	/**
	 * Overloaded constructor with attributes
	 * @param recipientAddress String containing the address of the recipient
	 * @param senderAddress String containing a single address of a recipient
	 * @param messageText String containing a message text
	 */
	public Print(String recipientAddress, String senderAddress, String messageText){
		// instantiate with correct types
		addRecipient(new PrintAddress(recipientAddress));
		setSender(new PrintAddress(senderAddress));
		setBody(new PrintBody(messageText));
	}

	/************************************************************************************/
	/* Methods
	/*----------------------------------------------------------------------------------*/
	@Override
	public void addRecipient(String recipient) {
		addRecipient(new PrintAddress(recipient));
		
	}
	
	/************************************************************************************/
	/* START Validation
	/*----------------------------------------------------------------------------------*/
	/**
	 * Validate message
	 */
	public List<Status> validate(){
		super.validate();
		// add additional validations here if neccessary
		return statusList;
	}
	/*----------------------------------------------------------------------------------*/
	/* END Validation
	/************************************************************************************/

	
	/************************************************************************************/
	/* START Setters/Getters
	/*----------------------------------------------------------------------------------*/
	@Override
	public void setSender(String sender) {
		setSender(new PrintAddress(sender));	
	}
	public void setBody(String text){
		setBody(new PrintBody(text));
	}
	public MessageType getMessageType(){
		return MessageType.PRINT;
	}
	/*----------------------------------------------------------------------------------*/
	/* END Setters/Getters
	/************************************************************************************/

}
